//
//  YYEAcountHeaderCell.m
//  YuYingEDU
//
//  Created by 胡波 on 2018/1/9.
//  Copyright © 2018年 胡波. All rights reserved.
//

#import "YYEAcountHeaderCell.h"

@implementation YYEAcountHeaderCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.nameLabel = [[UILabel alloc]init];
        self.nameLabel.textColor = [UIColor blackColor];
        self.nameLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.nameLabel];
        
        self.rightIV = [[UIImageView alloc]init];
        self.rightIV.image = [UIImage imageNamed:@"right"];
        [self.contentView addSubview:self.rightIV];
        
        self.headerIV = [[UIImageView alloc]init];
        [self.contentView addSubview:self.headerIV];
        
        self.lineView = [[UIView alloc]init];
        self.lineView.backgroundColor = GeneralBackColor;
        [self.contentView addSubview:self.lineView];
        
        self.nameLabel.text = @"头像";
        self.headerIV.image = [UIImage imageNamed:@"headerHolder"];
        
    }
    return self;
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.nameLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(20);
        make.centerY.equalTo(self.contentView.centerY);
    }];
    
    [self.rightIV makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.right).offset(-10);
        make.centerY.equalTo(self.contentView.centerY);
        make.size.equalTo(CGSizeMake(8, 13));
    }];
    
    [self.headerIV makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.rightIV.left).offset(-10);
        make.centerY.equalTo(self.contentView.centerY);
        make.size.equalTo(CGSizeMake(50, 50));
    }];
    
    [self.lineView makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(20);
        make.right.equalTo(self.contentView.right).offset(-20);
        make.bottom.equalTo(self.contentView.bottom);
        make.height.equalTo(0.5);
    }];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
